From 4500fa633b5a8340f8f22bc42fe2046c0439f8f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20=C3=85dahl?= Date: Sun, 5 Mar 2023 20:54:40 +0100 Subject: [PATCH] wayland: Destroy xdg_surface after role The split-up of gdksurface-wayland.c introduced a protocol violation when it didn't make sure xdg_surface was destroyed after the role objects (xdg_popup / xdg_toplevel). Fix that. Fixes: 2a463baed0 ("wayland: Rearrange the surface code") --- gdk/wayland/gdksurface-wayland.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 7571c6aa55..21488fc987 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -971,6 +971,15 @@ gdk_wayland_surface_hide_surface (GdkSurface *surface) impl->display_server.egl_window = NULL; } + impl->awaiting_frame = FALSE; + if (impl->awaiting_frame_frozen) + { + impl->awaiting_frame_frozen = FALSE; + gdk_surface_thaw_updates (surface); + } + + GDK_WAYLAND_SURFACE_GET_CLASS (impl)->hide_surface (impl); + if (impl->display_server.xdg_surface) { xdg_surface_destroy (impl->display_server.xdg_surface); @@ -989,15 +998,6 @@ gdk_wayland_surface_hide_surface (GdkSurface *surface) impl->initial_configure_received = FALSE; } - impl->awaiting_frame = FALSE; - if (impl->awaiting_frame_frozen) - { - impl->awaiting_frame_frozen = FALSE; - gdk_surface_thaw_updates (surface); - } - - GDK_WAYLAND_SURFACE_GET_CLASS (impl)->hide_surface (impl); - g_clear_pointer (&impl->display_server.wl_surface, wl_surface_destroy); g_slist_free (impl->display_server.outputs); -- 2.30.2